\(\int (a \sin (c+d x)+b \tan (c+d x)) \, dx\) [232]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 26 \[ \int (a \sin (c+d x)+b \tan (c+d x)) \, dx=-\frac {a \cos (c+d x)}{d}-\frac {b \log (\cos (c+d x))}{d} \]

[Out]

-a*cos(d*x+c)/d-b*ln(cos(d*x+c))/d

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2718, 3556} \[ \int (a \sin (c+d x)+b \tan (c+d x)) \, dx=-\frac {a \cos (c+d x)}{d}-\frac {b \log (\cos (c+d x))}{d} \]

[In]

Int[a*Sin[c + d*x] + b*Tan[c + d*x],x]

[Out]

-((a*Cos[c + d*x])/d) - (b*Log[Cos[c + d*x]])/d

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = a \int \sin (c+d x) \, dx+b \int \tan (c+d x) \, dx \\ & = -\frac {a \cos (c+d x)}{d}-\frac {b \log (\cos (c+d x))}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.42 \[ \int (a \sin (c+d x)+b \tan (c+d x)) \, dx=-\frac {a \cos (c) \cos (d x)}{d}-\frac {b \log (\cos (c+d x))}{d}+\frac {a \sin (c) \sin (d x)}{d} \]

[In]

Integrate[a*Sin[c + d*x] + b*Tan[c + d*x],x]

[Out]

-((a*Cos[c]*Cos[d*x])/d) - (b*Log[Cos[c + d*x]])/d + (a*Sin[c]*Sin[d*x])/d

Maple [A] (verified)

Time = 0.31 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.96

method result size
derivativedivides \(\frac {-\cos \left (d x +c \right ) a -b \ln \left (\cos \left (d x +c \right )\right )}{d}\) \(25\)
parallelrisch \(\frac {-\cos \left (d x +c \right ) a +b \ln \left (\sqrt {\sec \left (d x +c \right )^{2}}\right )+a}{d}\) \(29\)
default \(\frac {b \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}-\frac {a \cos \left (d x +c \right )}{d}\) \(31\)
parts \(\frac {b \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}-\frac {a \cos \left (d x +c \right )}{d}\) \(31\)
risch \(i b x +\frac {2 i b c}{d}-\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}-\frac {a \cos \left (d x +c \right )}{d}\) \(45\)
norman \(\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}+\frac {b \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}\) \(51\)

[In]

int(sin(d*x+c)*a+b*tan(d*x+c),x,method=_RETURNVERBOSE)

[Out]

1/d*(-cos(d*x+c)*a-b*ln(cos(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.96 \[ \int (a \sin (c+d x)+b \tan (c+d x)) \, dx=-\frac {a \cos \left (d x + c\right ) + b \log \left (-\cos \left (d x + c\right )\right )}{d} \]

[In]

integrate(a*sin(d*x+c)+b*tan(d*x+c),x, algorithm="fricas")

[Out]

-(a*cos(d*x + c) + b*log(-cos(d*x + c)))/d

Sympy [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.42 \[ \int (a \sin (c+d x)+b \tan (c+d x)) \, dx=a \left (\begin {cases} - \frac {\cos {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \sin {\left (c \right )} & \text {otherwise} \end {cases}\right ) + b \left (\begin {cases} \frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} & \text {for}\: d \neq 0 \\x \tan {\left (c \right )} & \text {otherwise} \end {cases}\right ) \]

[In]

integrate(a*sin(d*x+c)+b*tan(d*x+c),x)

[Out]

a*Piecewise((-cos(c + d*x)/d, Ne(d, 0)), (x*sin(c), True)) + b*Piecewise((log(tan(c + d*x)**2 + 1)/(2*d), Ne(d
, 0)), (x*tan(c), True))

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.96 \[ \int (a \sin (c+d x)+b \tan (c+d x)) \, dx=-\frac {a \cos \left (d x + c\right )}{d} + \frac {b \log \left (\sec \left (d x + c\right )\right )}{d} \]

[In]

integrate(a*sin(d*x+c)+b*tan(d*x+c),x, algorithm="maxima")

[Out]

-a*cos(d*x + c)/d + b*log(sec(d*x + c))/d

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.04 \[ \int (a \sin (c+d x)+b \tan (c+d x)) \, dx=-\frac {a \cos \left (d x + c\right )}{d} - \frac {b \log \left ({\left | \cos \left (d x + c\right ) \right |}\right )}{d} \]

[In]

integrate(a*sin(d*x+c)+b*tan(d*x+c),x, algorithm="giac")

[Out]

-a*cos(d*x + c)/d - b*log(abs(cos(d*x + c)))/d

Mupad [B] (verification not implemented)

Time = 22.07 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.54 \[ \int (a \sin (c+d x)+b \tan (c+d x)) \, dx=\frac {2\,b\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d}-\frac {2\,a}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]

[In]

int(a*sin(c + d*x) + b*tan(c + d*x),x)

[Out]

(2*b*atanh(tan(c/2 + (d*x)/2)^2))/d - (2*a)/(d*(tan(c/2 + (d*x)/2)^2 + 1))